# docker build -t="public/keyid-admin:latest" -f deploy/Dockerfile . --build-arg STAGE=dev
# docker run  -p 80:80 -p 443:443 -ti public/keyid-admin:latest
# 构建环境
FROM zw-main-registry.cn-shanghai.cr.aliyuncs.com/zw-image-base/build-stage-vue-pnpm:latest as build-stage
ARG STAGE
COPY ./ /tmp/build/
WORKDIR /tmp/build/
COPY package-${STAGE}.json package.json
RUN pnpm install
RUN pnpm run build:${STAGE}

# FROM zw-main-registry.cn-shanghai.cr.aliyuncs.com/zw-image-base/env-nginx-for-vue-dist:v0.0.1
FROM zw-main-registry.cn-shanghai.cr.aliyuncs.com/zw-image-base/env-nginx-for-vue-dist:latest
ARG STAGE
RUN mkdir -p /data/www/payhub.keyid.cn/
RUN mkdir -p /data/logs/nginx/
COPY --from=build-stage /tmp/build/dist /data/www/payhub.keyid.cn/
ADD ./deploy/${STAGE}/payhub.keyid.cn.conf /etc/nginx/conf.d/payhub.keyid.cn.conf

